<layout name='layout' />

<div class="admin-main">

	<blockquote class="layui-elem-quote">

		<a href="<{:U('Option/index')}>" class="layui-btn layui-btn-small">
			<i class="layui-icon">&#xe603;</i> 返回列表
		</a>
		
		<button class="layui-btn layui-btn-small" onclick="openModel('<{:U('Item/add',array('id'=>$list['id']))}>','添加','600px','300px');">
			<i class="layui-icon">&#xe608;</i> 添加
		</button>		

		<button class="layui-btn layui-btn-small" onclick="window.location.reload();">
			<i class="fa fa-refresh"></i> 刷新
		</button>

		<button class="layui-btn layui-btn-small layui-btn-danger" id="delBtn">
			<i class="fa fa-close"></i> 删除
		</button>

		<div class="search">
			
		</div>
	</blockquote>

	<fieldset class="layui-elem-field">
		<legend><{$list['name']}></legend>
		<div class="layui-field-box">
			<form id="ajaxForm" method="post" action="<{:U('Item/del')}>">
			<table class="site-table table-hover">
				<thead>
					<tr>
						<th style="width: 50px"><input type="checkbox" id="selected-all"></th>								
						<TH>选项名称</TH>
						<TH>值</TH>
						<TH style="width: 150px">添加日期</TH>
						<TH style="width: 150px">更新日期</TH>
						<TH style="width: 100px">操作</TH>
					</tr>
				</thead>
				<tbody>
					<volist name="cate" id="vo">
					<tr>
					  <td><input type="checkbox" name="selectedids[]" value="<{$vo.id}>" id="<{$vo.id}>"> <{$vo.id}></td>
					  <td><{$vo.name}></td>
					  <td><{$vo.value}></td>
		              <td><{$vo.createTime|date='Y-m-d H:i:s',###}></td>
		              <td><{$vo.updateTime|date='Y-m-d H:i:s',###}></td>
					  <td>
					  <a href="javascript:;" onclick="openModel('<{:U('Item/edit' , array('id'=>$vo['id']))}>','编辑','600px','300px');" class="layui-btn layui-btn-mini">编辑</a>

					  </td>
					</tr>
					</volist>					
				</tbody>
			</table>
			<input type="hidden" name="mpath" id="mpath">
			</form>
		</div>
	</fieldset>
	<div class="admin-table-page">
		<div id="page" class="page"><{$page}></div>
	</div>
</div>

<script type="text/javascript">
$("#path").val("<{$path}>");

$("#moveBtn").click(function(){
	_html = '<div style="padding:20px;">';
	_html += '<select name="pathSel" id="pathSel" style="padding:4px 0" onchange="setPath()">';
	<volist name="sclass" id="vo">
	_html += '<option value="<{$vo['id']}>,<{$vo['path']}>"><php>
		            for($i=0; $i<$vo['count']*2; $i++){
		               echo '&nbsp;&nbsp;';            
		            }
		        </php><{$vo['name']}></option>';
	</volist>
	_html += '</select>';
	_html += '</div>';
	layer.open({
		type: 1,
		title:'批量移动',
		area: ['420px', '200px'], //宽高
		btn: ['确定'],
		content: _html,
		yes:function(index){			 
			layer.close(index);
			$('#ajaxForm').attr('action', '<{:U('Goods/move')}>');
			$('#ajaxForm').submit();
		}
	});
});

function setPath(){
	$("#mpath").val($("#pathSel").val());
}
</script>
		
